<extend name="Public/base"/>
<block name="style">
    <link rel="stylesheet" type="text/css" href="__CSS__/tabStyle.css" media="all">
    <script type="text/javascript" src="__JS__/tabScript.js"></script>
</block>
<block name="body">
	<div class="main-title">
		<h2>代发货订单统计</h2>
	</div>
    <div class="tools auth-botton">
        <a class="btn" href="{:U('expOrderFordfh')}">Excel导出</a>
    </div>
    <ul class="tabs">
        <volist name="typelist" id="type">
            <li><a href="#" name=".tab1_{$i}">{$type.name}</a></li>
        </volist>     
    </ul>
    <div id="tablediv" class="content">
        <volist name="typelist" id="type" key="k">
            <div class="tab1_{$k} data-table table-striped">
                <table class="" id="dtable">
                    <thead>
                        <tr>
                            <th>商品名称</th>
                            <th>规格名称</th>
                            <th>代发货数量</th>
                        </tr>
                    </thead>
                    <tbody>
                        <notempty name="type['orderlist']">
                        <volist name="type['orderlist']" id="vo">
                            <tr>
                                <td>{$vo.goods_name}</td>
                                <td>{$vo.spe_name}</td>
                                <td>{$vo.totalnum}</td>
                            </tr>
                        </volist>
                        <else/>
                        <td colspan="3" class="text-center">暂时还没有数据！</td>
                        </notempty>
                    </tbody>
                </table>
            </div>
        </volist>
    </div>
</block>
<block name="script">
    <script type="text/javascript">
    	$(function(){
            loadTab();

            var selall = $(this).find("select");

            $("select",this).change(function(){
            	var speid = $(this).parents("tr").find("#spe").val();
            	var sel = $(this);
            	$.get("{:U('Order/getGoodsSpe')}",{speid:speid},function(data){
                    if(data != null){
                		sel.parents("tr").find("#unit").html(data['unit']);
                		sel.parents("tr").find("#price").val(data['price']);
                    }
            	})
            });

        });
        //导航高亮
        highlight_subnav('{:U('Statistics/index')}');
    </script>
</block>